package cn.qayy.po;

import java.util.Date;

import cn.qayy.dto.PrizeDTO;

/**
 * 
 * 
 * @author wangyu
 * 中奖纪录
 * @date 2018-09-06
 */
public class WxPrize {
	private Integer id;
	
    private String openid;

    /**
     * 奖品名称
     */
    private String prizeName;

    /**
     * 发货日期
     */
    private String deliveryTime;

    /**
     * 发货状态
     */
    private String deliveryStatus;

    /**
     * 发货人
     */
    private String deliveryMan;

    /**
     * 收货人
     */
    private String consignee;

    /**
     * 收货地址
     */
    private String address;
    
    private String flag;
    
    private Date ctime=new Date();
    
    private Date mtime=new Date();
    
    public Date getCtime() {
		return ctime;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

	public Date getMtime() {
		return mtime;
	}

	public void setMtime(Date mtime) {
		this.mtime = mtime;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid == null ? null : openid.trim();
    }

    public String getPrizeName() {
        return prizeName;
    }

    public void setPrizeName(String prizeName) {
        this.prizeName = prizeName == null ? null : prizeName.trim();
    }

    public String getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(String deliveryTime) {
        this.deliveryTime = deliveryTime == null ? null : deliveryTime.trim();
    }

    public String getDeliveryStatus() {
        return deliveryStatus;
    }

    public void setDeliveryStatus(String deliveryStatus) {
        this.deliveryStatus = deliveryStatus == null ? null : deliveryStatus.trim();
    }

    public String getDeliveryMan() {
        return deliveryMan;
    }

    public void setDeliveryMan(String deliveryMan) {
        this.deliveryMan = deliveryMan == null ? null : deliveryMan.trim();
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee == null ? null : consignee.trim();
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }
    
    public WxPrize() {
		super();
	}

	
	public WxPrize(Integer id, String openid, String prizeName, String deliveryTime, String deliveryStatus,
			String deliveryMan, String consignee, String address, String flag) {
		super();
		this.id = id;
		this.openid = openid;
		this.prizeName = prizeName;
		this.deliveryTime = deliveryTime;
		this.deliveryStatus = deliveryStatus;
		this.deliveryMan = deliveryMan;
		this.consignee = consignee;
		this.address = address;
		this.flag = flag;
	}

	@Override
	public String toString() {
		return "WxPrize [id=" + id + ", openid=" + openid + ", prizeName=" + prizeName + ", deliveryTime="
				+ deliveryTime + ", deliveryStatus=" + deliveryStatus + ", deliveryMan=" + deliveryMan + ", consignee="
				+ consignee + ", address=" + address + ", flag=" + flag + "]";
	}

	/**
	 * 通过DTO初始化
	 * @param dto
	 * @return
	 */
	public WxPrize setByDTO(PrizeDTO dto) {
		this.setOpenid(dto.getOpenid());
		this.setPrizeName(dto.getPrizeName());
		this.setDeliveryTime(dto.getDeliveryTime());
		this.setDeliveryStatus(dto.getDeliveryStatus());
		this.setDeliveryMan(dto.getDeliveryMan());
		this.setConsignee(dto.getConsignee());
		this.setAddress(dto.getAddress());
		this.setFlag(dto.getFlag());
		return this;
	}
}